<?php
namespace app\index\controller;

class Api extends Base{
	public function index(){
    	$data = db('picture')->where('status=99')->order('id desc')->limit(10)->select();
    	echo $_GET['callback'].'('.json_encode($data).')';
	}
	public function detail(){
    	$id = input('param.id');
    	$r = db('picture')->where('id='.$id)->find();
    	$r1 = db('picture_data')->where('id='.$id)->find();
    	$data = array_merge($r, $r1);
    	echo $_GET['callback'].'('.json_encode($data).')';
	}
}